package com.llg.controller;

import com.llg.model.response.DataResult;
import com.llg.model.response.ResponseResult;
import com.llg.pojo.LedMatchReceive;
import com.llg.service.LedMatchReceiveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/LedMatchReceive")
public class LedMatchReceiveController {
    @Autowired
    private LedMatchReceiveService service;

    //通过id查
    @GetMapping("/{id}")
    public DataResult<LedMatchReceive> findById( @PathVariable("id") Integer id){
        return service.findById(id);
    }

    //增
    @PostMapping("/add")
    public DataResult<LedMatchReceive> add(@RequestBody LedMatchReceive ledMatchReceive){
        return service.add(ledMatchReceive);
    }

    //删
    @GetMapping("/delete/{id}")
    public ResponseResult delete(@PathVariable("id") int id){
        return service.delete(id);
    }

    //改
    @PostMapping("/update")
    public ResponseResult update(@RequestBody LedMatchReceive ledMatchReceive){
        return service.update(ledMatchReceive);
    }
}
